<% javascript('colorpicker') %>
<div id="<%= active_scaffold_id -%>" class="active-scaffold active-scaffold-<%= controller_id %> <%= controller_class %> <%= active_scaffold_config.theme %>-theme">
  <div class="active-scaffold-header">
    <%= render :partial => 'list_header' %>
  </div>
  <table cellpadding="0" cellspacing="0">
    <tbody class="before-header" id="<%= before_header_id -%>">
      <% if active_scaffold_config.list.always_show_search %>
        <tr>
          <td>
            <div class="active-scaffold show_search-view <%= controller_class %> view">
              <%= render :partial => active_scaffold_config.list.search_partial %>
            </div> 
          </td> 
        </tr>
      <% else %>
      <tr><td></td></tr>
      <% end %>
      <% if params[:nested].nil? && active_scaffold_config.list.always_show_create %>
        <tr> 
          <td> 
            <div  class="active-scaffold create-view <%= controller_class %> view">
              <%= render :partial => 'create_form_on_list' %>
            </div> 
          </td> 
        </tr>
      <% end %>
    </tbody>
  </table>
  <div id="<%= active_scaffold_content_id -%>">
    <%= render :partial => 'list' %>
  </div>
</div>

<script type="text/javascript">
//<![CDATA[
<% if active_scaffold_config.theme != :default -%>
Rico.Corner.round($$('#<%= active_scaffold_id %> div.active-scaffold-header').first(), {color: 'fromElement', bgColor: 'fromParent', corners: 'top', compact: true});
Rico.Corner.round($$('#<%= active_scaffold_id %> div.active-scaffold-footer').first(), {color: 'fromElement', bgColor: 'fromParent', corners: 'bottom', compact: true});
<% end -%>
new ActiveScaffold.Actions.Table($$('#<%= active_scaffold_id -%> div.active-scaffold-header a.action'), $('<%= before_header_id -%>'), $('<%= loading_indicator_id(:action => :index) -%>'));
ActiveScaffold.server_error_response = '<p class="error-message message">'
  + <%= as_(:internal_error).to_json.html_safe %>
  + '<a href="#" onclick="Element.remove(this.parentNode); return false;">'
  + <%= as_(:close).to_json.html_safe %>
  + '</a>'
  + '</p>';
//]]>
</script>
